﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class Admin_frmTaoDeIn : System.Web.UI.Page
{
    clsDecon obj_decon = new clsDecon();
    protected void Page_Load(object sender, EventArgs e)
    {
        btnTaoDeIn.Attributes.Add("onclick", "return xacnhan();");
    }
    protected void btnTaoDeIn_Click(object sender, EventArgs e)
    {
        string madt = drlTenDT.SelectedValue;
        obj_decon.TaoCTDeCon(madt);
        drlDecon.DataBind();
        drlDecon.SelectedIndex= drlDecon.Items.Count - 1;
    }
    protected void btnIn_Click(object sender, EventArgs e)
    {
        
        //=SqlDataSource2.Select(DataSourceSelectArguments.Empty)
        string tenmonhoc = DetailsView1.Rows[3].Cells[1].Text;
        string url = "";
        url = "Print.aspx?madethi=" + drlTenDT.SelectedValue + "&madecon=" + drlDecon.SelectedValue+"&tenmonhoc="+tenmonhoc;
        //Response.Redirect(url);
        //Response.Write("<script type='text/javascript'>window.open('QuanLyGiangVien.aspx');</script>");
        Page page = (Page)HttpContext.Current.Handler; 
        string script = @"window.open(""{0}"", ""{1}"");";
        script = String.Format(script, url, "_blank"); 
        ScriptManager.RegisterStartupScript(page, typeof(Page), "Redirect", script, true); 
         
    }
}
